package main

import (
	"context"
	"fmt"
	"google.golang.org/grpc"
	"net"
	"sinery.net.goft/myproto"
)

type UserServiceImpl struct {
}

func (u *UserServiceImpl) SayHello(context.Context, *myproto.ArgsSayHello) (*myproto.ReplySayHello, error) {
	return &myproto.ReplySayHello{Res: "sin"}, nil
}
func main() {
	lis, err := net.Listen("tcp", "127.0.0.1:8080")
	if err != nil {
		fmt.Println(err)
		return
	}
	s := grpc.NewServer()
	myproto.RegisterHelloServceServer(s, new(UserServiceImpl))
	fmt.Println("Server listening on 127.0.0.1:8080\n")
	s.Serve(lis)
}
